package com.cdu.supermarket.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.cdu.supermarket.entity.domain.GoodsAttributeValue;
import com.cdu.supermarket.mapper.GoodsAttributeValueMapper;
import com.cdu.supermarket.service.IGoodsAttributeValueService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsAttributeValueServiceImpl extends ServiceImpl<GoodsAttributeValueMapper, GoodsAttributeValue> implements IGoodsAttributeValueService {
    
    @Override
    public List<GoodsAttributeValue> listByGoodsId(Long goodsId) {
        return baseMapper.findByGoodsId(goodsId);
    }
    
    @Override
    public boolean removeByGoodsId(Long goodsId) {
        QueryWrapper<GoodsAttributeValue> wrapper = new QueryWrapper<>();
        wrapper.eq("goods_id", goodsId);
        return remove(wrapper);
    }
} 